#include <string> 
#include <unordered_map>
#include <fstream>
using namespace std;

class Dict
{
public:
    Dict(string path)
    {
        ifstream in(path);
        
        string s;
        while(getline(in, s))
        {
            int pos= s.find(": ");
            if(pos== string::npos) continue;
            _dict[s.substr(0, pos)]= s.substr(pos+2,string::npos);
        }

        in.close();

    }

    void Translate(string key, string& value)
    {
        if(_dict.find(key)== _dict.end()) 
        {
            value= "未知";
            return ;
        }
        value= _dict[key];
    }

private:
    unordered_map<string, string> _dict;
};


